﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lxzhu.OpenGL
{
    /// <summary>
    /// 获取Modifier的状态
    /// </summary>
    public class GlutModifierState
    {
        public const int GLUT_ACTIVE_SHIFT = 1;
        public const int GLUT_ACTIVE_CTRL = 2;
        public const int GLUT_ACTIVE_ALT = 4;
        public static GlutModifierState GetModifierState()
        {
            return new GlutModifierState();
        }
        public GlutModifierState()
        {
            mModifierCode = Glut.glutGetModifiers();
        }
        public bool ShiftOn
        {
            get
            {
                return (mModifierCode & GLUT_ACTIVE_SHIFT)!= 0;
            }
        }
        public bool CtrlOn
        {
            get
            {
                return (mModifierCode & GLUT_ACTIVE_CTRL) != 0;
            }
        }
        public bool AltOn
        {
            get
            {
                return (mModifierCode & GLUT_ACTIVE_ALT) != 0;
            }
        }
        private int mModifierCode = 0;
    }
}
